package cn.bugstack.domain.strategy.model.entity;

import cn.bugstack.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * 经过 规则过滤后的 规则行为实体类
 */


@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity <T extends RuleActionEntity.RaffleEntity>{


    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();

    private String ruleModel;
    private T data;


    /**
     * 返回抽奖规则实体类 模板实体类
     */
    public static class RaffleEntity {

    }

    /**
     *  抽奖前的 规则策略
     *  看用户是否是 走规则权重rule_weight 还是 走规则黑名单rule_blacklist
     */
    @EqualsAndHashCode(callSuper=true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class RaffleBeforeEntity extends RaffleEntity{

        private Long strategyId;
        /**
         * 用于抽奖时可以选择权重抽奖
         */
        private String ruleWeightValueKey;

        private Integer awardId;
    }

    /**
     * 抽奖中的 规则策略
     * 看用户 走 随机积分rule_random 还是 抽奖1、2、6次解锁的 策略rule_lock
     */

    public static class RaffleCenterEntity extends RaffleEntity{

    }

    /**
     * 抽奖后的 规则策略
     * 看用户走兜底奖品 策略的哪一个 rule_luck_award
     */
    public static class RaffleAfterEntity extends RaffleEntity{

    }


}
